from launch import LaunchDescription
from launch_ros.actions import Node
import os
from ament_index_python.packages import get_package_share_directory


def generate_launch_description():
    param_front = os.path.join(
        get_package_share_directory(
            "laser_can"), "launch", "laser_front.yaml"
    )
    param_back = os.path.join(get_package_share_directory(
        "laser_can"), "launch", "laser_back.yaml")
    node_front = Node(
        package="laser_can", executable="laser_node", parameters=[param_front], namespace="front", output="screen"
    )
    node_back = Node(
        package="laser_can", executable="laser_node", parameters=[param_back], namespace="back", output="screen"
    )
    launch_description = LaunchDescription([node_front, node_back])
    return launch_description
